import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class ChatServer {
    public ChatServer(){
        try {
            ServerSocket server = new ServerSocket(9900);
            System.out.println("聊天服务器启动...");
            while(true){
                Socket socket = server.accept();
                new Thread(new ChatChannel(socket)).start();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    public static void main(String[] args) {
        new ChatServer();
    }
}
